🪶 Tynm -- Type Name
Returns type names with a specifiable number of module segments as a String
.
Usage
Add the following to Cargo.toml
= "0.1.10"
In code:
assert_eq!;
let tuples = vec!;
tuples
.iter
.for_each;
Motivation
The core::any::type_name
function stabilized in Rust 1.38 returns the fully qualified type
name with all module segments. This can be difficult to read in error messages, especially for
type-parameterized types.
Often, the simple type name is more readable, and enough to distinguish the type referenced in an error.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.